import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/algorithm/:typeId',
    name: 'AlgorithmDetail',
    component: () => import('../views/algorithms/AlgorithmDetail.vue'),
    props: true
  },
  {
    path: '/practice',
    name: 'Practice',
    component: () => import('../views/Practice.vue')
  },
  {
    path: '/resources',
    name: 'Resources',
    component: () => import('../views/Resources.vue')
  },
  {
    path: '/divide-and-conquer',
    name: 'DivideAndConquer',
    component: () => import('../views/algorithms/DivideAndConquer.vue')
  },
  {
    path: '/dynamic-programming',
    name: 'DynamicProgramming',
    component: () => import('../views/algorithms/DynamicProgramming.vue')
  },
  {
    path: '/greedy',
    name: 'Greedy',
    component: () => import('../views/algorithms/Greedy.vue')
  },
  {
    path: '/backtracking',
    name: 'Backtracking',
    component: () => import('../views/algorithms/Backtracking.vue')
  },
  {
    path: '/case-detail/:id',
    name: 'AlgorithmCaseDetail',
    component: () => import('../views/algorithms/AlgorithmCaseDetail.vue'),
    props: true
  },
  {
    path: '/ai-chat',
    name: 'AIChat',
    component: () => import('../views/AIChat.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
